package com.kede.dao;

import com.kede.entity.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 【请填写作者】
 * @since 2020-03-27
 */
@Repository
public interface MenuDao extends BaseMapper<Menu> {

    @Select("SELECT m.* FROM menu m LEFT JOIN role_menu ram ON m.id=ram.menu_id WHERE ram.role_id=#{rid}")
    List<Menu> getListByRoleId(@Param("rid") Long id);
}
